﻿using System;

namespace Ast.Core.Pe.Definitions
{
    [Flags]
    public enum SectionCharacteristics : uint
    {
        Regular = 0x00000000, // Reserved.
        DSection = 0x00000001, // Reserved.
        NoLoad = 0x00000002, // Reserved.
        Group = 0x00000004, // Reserved.
        SoPad = 0x00000008, // Reserved.
        Copy = 0x00000010, // Reserved.

        Code = 0x00000020, // Section contains code.
        InitializedData = 0x00000040, // Section contains initialized data.
        UninitializedData = 0x00000080, // Section contains uninitialized data.

        Other = 0x00000100, // Reserved.
        LinkerInfo = 0x00000200, // Section contains comments or some other type of information.
        Over = 0x00000400, // Reserved.
        Removable = 0x00000800, // Section contents will not become part of image.
        Comdat = 0x00001000, // Section contents comdat.
        Reserved2 = 0x00002000, // Reserved.
        MemoryPRotected = 0x00004000,
        NoDeferSpeculativeExceptions = 0x00004000, // Reset speculative exceptions handling bits in the TLB entries for this section.
        GpRelative = 0x00008000, // Section content can be accessed relative to GP
        FarData = 0x00008000,
        SysHeap = 0x00010000,
        Purgeable = 0x00020000,
        Memory16Bit = 0x00020000,
        MemoryLocked = 0x00040000,
        MemoryPreload = 0x00080000,

        Align1Byte = 0x00100000, //
        Align2Bytes = 0x00200000, //
        Align4Bytes = 0x00300000, //
        Align8Bytes = 0x00400000, //
        Align16Bytes = 0x00500000, // Default alignment if no others are specified.
        Align32Bytes = 0x00600000, //
        Align64Bytes = 0x00700000, //
        Align128Bytes = 0x00800000, //
        Align256Bytes = 0x00900000, //
        Align512Bytes = 0x00A00000, //
        Align1KBytes = 0x00B00000, //
        Align2KBytes = 0x00C00000, //
        Align4KBytes = 0x00D00000, //
        Align8KBytes = 0x00E00000, //
        AlignmentMask = 0x00F00000,

        ContainsExtendedRelocations = 0x01000000, // Section contains extended relocations.
        MemoryDiscardable = 0x02000000, // Section can be discarded.
        NotCached = 0x04000000, // Section is not cachable.
        NotPageable = 0x08000000, // Section is not pageable.
        Shared = 0x10000000, // Section is shareable.
        Executable = 0x20000000, // Section is executable.
        Readable = 0x40000000, // Section is readable.
        Writable = 0x80000000, // Section is writeable.
    }
}